package com.appointment.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.appointment.dao.WebDao;
import com.appointment.entity.Web;

@Controller
public class WebMessageController {
	
	@Resource
	WebDao webdao;
	
	@RequestMapping("/index")
	public String index(Model model){
		Web web = webdao.findWeb();
		model.addAttribute("message", web);
		
		return "index";
	}
	
	
	
	//增加管理信息
	@RequestMapping("/sendMes")
	public String sendMes(Web web){
		webdao.updateWebMes();
		webdao.addMessage(web);
		return "redirect:index";
	}
	
	@RequestMapping("/error")
	public String error(){
		return "error";
	}
}
